package com.gupaoedu.pattern.observer.gper;

/**
 * 2019/9/28
 * created by chenpp
 */
public class GPerTest {
    public static void main(String[] args) {
        GPer gper = new GPer();
        gper.setName("咕泡生态圈");

        Question question = new Question();
        question.setName("chenpp");
        question.setContent("适配器模式和装饰器模式的区别");

        Teacher jane = new Teacher("jane");
        Teacher bob = new Teacher("bob");

        //被观察者需要注册观察者，并且要在发布消息之前
        gper.addObserver(jane);
        gper.addObserver(bob);

        gper.publishQuestion(question);
    }
}
